<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>所有单位--待办项目</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="/lib/layui/css/layui.css">
    <link rel="stylesheet" href="/static/css/weadmin.css">
    <script type="text/javascript" src="/templates/act/process-xl.js"></script>
    <!-- 注意：如果你直接复制所有代码到本地，上述css路径需要改成你本地的 -->
</head>
<body>
<form class="layui-form searchForm" action="">
    查询:
    <div class="layui-input-inline">
        <input style="width:200px;" type="text" name="prjName" placeholder="项目名称/申报编号" autocomplete="off"
               class="layui-input">
    </div>
    <button class="layui-btn" lay-submit lay-filter="formDemo">查询</button>
    <button class="layui-btn" lay-submit lay-filter="formClear">清空</button>
</form>
<table class="layui-hide" id="dataList" lay-filter="dataList"></table>

<script type="text/html" id="barDemo">
    <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="{{d.procDefKey}}">详情</a>
</script>

<script type="text/javascript" src="/lib/layui/layui.js"></script>
<script src="/static/js/main.js"></script>
<script>
    var configureCom = {};
    layui.use(['jquery', 'configureCom', 'configure', 'sessionFun', 'table', 'matchDict'], function () {
        var $ = layui.jquery;
        var configure = layui.configure;
        var table = layui.table;
        var sessionFun = layui.sessionFun;
        var matchDict = layui.matchDict;
        configureCom = layui.configureCom;
        var iframeId = configureCom.GetQueryString('iframeId');//获得当前iframe页面的id
        var cols = [[
            {field: 'title', title: '标题'},
            {field: 'procDefName', title: '流程名称'},
            {field: 'name', title: '任务名称'},
            {field: 'startTime', title: '开始时间'},
            {type:'right',title: '操作',width:100, toolbar: '#barDemo'}
        ]];


        configureCom.tableRender(configure.PROC_WAIT_DEAL_API, {}, cols, 'dataList', 10,'full-70');

        //每行操作
        table.on('tool(dataList)', function (obj) {
            var data = obj.data;
            sessionFun.set(configure.SESSION_PROC_WAIT_DEAL_ROW_DATA, data);
            switch (obj.event) {
                case 'JGYS':
                    sessionFun.set('cptAcceptanceId',data.businessId );
                    sessionFun.set(configure.COMPLETION_ROW_DATA, null);
                    editItem('查看详情', '/pages/process/jgys/jgys2.html');      //查看待办列表详情
                    break;
                case 'ZZSG':
                    sessionFun.set('pauseId',data.businessId );
                    sessionFun.set(configure.PAUSE_ROW_DATA, null);
                    editItem('中止施工', '/pages/process/zzsg/zzsg.html');      //查看待办列表详情
                    break;
                default:
                    editItem('查看详情', configure.PROC_DEMO_DETAIL_DEAL_HTML); //查看待办列表详情
            }

        });

        /**
         * 新增或修改字典详情
         * @title 弹框标题
         * @htmlUrl 弹窗页面地址
         * **/
        function editItem(title, htmlUrl) {
            top.layer.open({
                type: 2,
                title: title,
                area: configureCom.Psize1,
                content: configureCom.nocache(htmlUrl, iframeId),
                success: function (layero, index) {
                    top.layer.full(index);
                },
                end: function () {
                    configureCom.tableReload();
                }
            });
        }

        //监听搜索
        configureCom.tableSearch();

    });
</script>
</body>
</html>